/**
 * 房屋认证审核
 *
 */

import request from "@/utils/request";

const APPLY_BASE_URL = "/api/v1/audit";

/**
 * 房屋认证审核-列表
 */
export function getHouseAuditList(queryParams: HouseAuditQueryParams) {
  return request<any, any>({
    url: `${APPLY_BASE_URL}/consumerHouse/page`,
    method: "post",
    data: queryParams,
  });
}
/**
 * 房屋认证审核-审核
 */
export function auditHouse(data: { id: number; status: number }) {
  return request<any, any>({
    url: `${APPLY_BASE_URL}/consumerHouse/audit`,
    method: "post",
    data: data,
  });
}

/**
 * 获取房屋档案详情
 */
export function getHouseById(data: HouseForm) {
  return request<any, any>({
    url: `${APPLY_BASE_URL}/getHouseById`,
    method: "post",
    data,
  });
}

/**
 * 矫正房屋门牌号
 */
export function updateConsumer(data: any) {
  return request({
    url: `api/v1/audit/consumerHouse/update/correctHouseNumber`,
    method: "post",
    data,
  });
}

/**
 * 矫正房屋户主名称
 */
export function updateConsumerOwnName(data: any) {
  return request({
    url: `api/v1/audit/consumerHouse/update/correctHouseOwnName`,
    method: "post",
    data,
  });
}


/**
 * 商户详情
 * @param merchantUserId
 */
export function getCompanyEnterInfo(merchantUserId: any) {
  return request({
    url: `/api/v1/audit/company/enterInfo/${merchantUserId}`,
    method: "get",
  });
}
/**
 * 房屋认证审核-审核结束状态
 */
export function auditEndStatus(data: {
  id: number;
  status: number; // （0申请中 1成功 2失败）
  percent: number; // 业主分佣百分比
  auditDesc: string; // 驳回原因
}) {
  return request<any, any>({
    url: `${APPLY_BASE_URL}/consumerHouse/auditEndStatus`,
    method: "post",
    data: data,
  });
}
export interface HouseAuditQueryParams {
  pageNum: number;
  pageSize: number;
}

export interface HouseForm {
  houseId: number;
  stepInfoList: [];
}
